<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>FLDCMS后台管理系统</title>
<meta name="keywords" content="FLDCMS，FLDCMS后台管理系统">
<meta name="description" content="FLDCMS，是一款由FLD开发的轻量级扁平化网站后台模板，适合中小型CMS后台系统。">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link href="__STATIC__/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="__STATIC__/h-ui.admin/css/H-ui.login.css" rel="stylesheet" type="text/css" />
<link href="__JS__/Hui-iconfont/1.0.8/iconfont.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="header">
	FLDCMS后台管理系统
</div>
<div class="loginWraper">
	<div id="loginform" class="loginBox">
	    <form id="login_form" class="form form-horizontal" method="post">
	      	<div class="row cl">
	        	<label class="form-label col-xs-3">
	        		<i class="Hui-iconfont">&#xe60d;</i>
	        	</label>
	        	<div class="formControls col-xs-8">
	          		<input id="username" name="username" type="text" placeholder="账户" class="input-text size-L">
	        	</div>
	      	</div>
	      	<div class="row cl">
	        	<label class="form-label col-xs-3">
	        		<i class="Hui-iconfont">&#xe60e;</i>
	        	</label>
	        	<div class="formControls col-xs-8">
	          		<input id="password" name="password" type="password" placeholder="密码" class="input-text size-L">
	        	</div>
	      	</div>
	      	<div class="row cl">
	        	<div class="formControls col-xs-8 col-xs-offset-3">
	          		<input class="input-text size-L" type="text" name="verifycode" placeholder="验证码" onblur="if(this.value==''){this.value='验证码'}" onclick="if(this.value=='验证码'){this.value='';}" style="width:150px;" maxlength="4">
	          		<img src="{:url('login/captcha')}" onclick="this.src='{:url('login/captcha')}'" style="cursor:pointer;" id="verify_code">
	          	</div>
	      	</div>
	      	<div class="row cl">
	        	<div class="formControls col-xs-8 col-xs-offset-3">
	          		<input type="submit" class="btn btn-success radius size-L" value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">
	          		<input type="reset" class="btn btn-default radius size-L" value="&nbsp;重&nbsp;&nbsp;&nbsp;&nbsp;置&nbsp;">
	        	</div>
	      	</div>
	    </form>
  </div>
</div>
<div class="footer">CopyRight © 2017 FLDCMS 版权所有</div>
<script type="text/javascript" src="__JS__/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="__STATIC__/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="__STATIC__/js/layer/2.4/layer.js"></script>
<script type="text/javascript" src="__STATIC__/js/jquery.form.js"></script>
<script type="text/javascript">
	$(function(){
		$('.btn-success').click(function(){
			$("#login_form").ajaxSubmit({
				url : "{:url('login/login')}",
				type : "post",
				dataType : 'json',
				success : function(data) {
					if(data.status != 1){
						layer.msg(data.msg, {time:1000,icon: 2});
						$('#verify_code').attr('src',"{:url('login/captcha')}");
						if(data.status == '1001'){
							$('input[name="verifycode"]').focus();
						}else if(data.status == '1003'){
							if($.trim($('input[name="username"]').val()) == ''){
								$('input[name="username"]').focus();
							}else{
								if($.trim($('input[name="password"]').val()) == ''){
									$('input[name="password"]').focus();
								}
							}
						}
					}else{
						window.location.href = "{:url('index/index')}";
					}
				},
				error: function (XMLHttpRequest, textStatus, errorThrown) {
					alert('操作失败');
					//alert(XMLHttpRequest.status);
	                //alert(XMLHttpRequest.readyState);
	                //alert(XMLHttpRequest.responseText);
				}
			});
			return false;
		});
	});
</script>
</body>
</html>